import time
from selenium import webdriver
from selenium.webdriver.common.by import By

# 打开浏览器,请求网址
driver = webdriver.Chrome()
driver.get('https://mail.qq.com/')

# 切换到frame
driver.switch_to.frame('login_frame')

# 定位用户名框
username = driver.find_element(By.ID, 'u')
username.send_keys('291700430')
time.sleep(2)
# 定位密码框
password = driver.find_element((By.ID, 'p'))
password.send_keys('')
time.sleep(2)
# 定位登录按钮
btn = driver.find_element(By.ID, 'login_button').click()